﻿@model IEnumerable<Gfw.Web.Models.Site.AnnouncementModel>

@{
    Layout = null;
}

@using C.Mvc
@using MvcContrib.UI.Grid;

@using (Ajax.BeginForm("List", "Announcement", null, Gfw.Web.Common.ViewHelper.AjaxGet))
{
 @Html.Grid(Model).Columns(
            column =>
            {
                column.For(x => x.AnnouncementTitle).Named("标题");
                column.For(x => x.AnnouncementKeyWord).Named("关键字");
                column.For(x => x.AnnouncementDate).Named("发布时间");
                column.For(x => x.AnnouncementPublisher).Named("发布人");
                column.For(x => x.IsShow?"是":"否").Named("是否可见");
                column.Custom(@<text>
        @Html.ActionLink("详情", "Detail", new {id = item.ID}) |
        @Html.ActionLink("编辑", "Edit", new { id = item.ID }) |
        @Ajax.ActionLink("删除", "Delete", new { id = item.ID }, new AjaxOptions()
   {
       UpdateTargetId = Gfw.Web.Common.ViewHelper.AjaxContainer,
       HttpMethod = "Post",
       InsertionMode = InsertionMode.Replace,
       Confirm = "确定要删除公告吗？"

   })
   </text>).Named("操作");

            }
    ).Attributes(id => "mytable",cellpadding=>"0",cellspacing=>"0").Empty("没有相关信息");


 @Ajax.DataGridPager().Totals(ViewBag.TotalSize).PageIndex(ViewBag.PageIndex).PagePropertyName("page").Model(new { did = ViewBag.did}).AjaxOptions(Gfw.Web.Common.ViewHelper.AjaxGet);
}
